import Vue from 'vue'
import App from './App.vue'
import router from "./router"
import ElementUI from "element-ui"
import 'element-ui/lib/theme-chalk/index.css';
import axios from "./axios/index"
import store from "./store/index" 
import "./assets/css/iconfont.css"
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'

Vue.prototype.$axios=axios
Vue.use(ElementUI)
Vue.config.productionTip = false
//全局过滤器
Vue.filter("dTimer",function(value){
  let dt=new Date(value);
  let y=dt.getFullYear();
  let m=(dt.getMonth()+1).toString().padStart(2,"0");
  let d=dt.getDate().toString().padStart(2,"0");
  let h=dt.getHours().toString().padStart(2,"0");
  let mm=dt.getMinutes().toString().padStart(2,"0");
  let s=dt.getSeconds().toString().padStart(2,"0");
  return `${y}-${m}-${d} ${h}:${mm}:${s}`
})

NProgress.configure({     
   easing: 'ease',  // 动画方式    
   speed: 500,  // 递增进度条的速度    
   showSpinner: false, // 是否显示加载ico    
   trickleSpeed: 200, // 自动递增间隔    
   minimum: 0.3 // 初始化时的最小百分比})
})

router.beforeEach((to, from , next) => {
 NProgress.start();
  next();
});
router.afterEach(() => {  
 NProgress.done()
})

new Vue({
  render: h => h(App),
  router,
  store
}).$mount('#app')